<?php
include 'db.php';

$username=trim($_GET['u']);
echo $subject;
$q=mysql_query("SELECT * FROM sessions WHERE `student`='{$username}' OR `tutor`='{$username}'");

while($data = mysql_fetch_row($q))
    if($data[1] == $username)
	    echo "$data[0]-$data[2]-$data[3]".PHP_EOL;
	else if($data[2] == $username)
	echo "$data[0]-$data[1]-$data[3]".PHP_EOL;
mysql_close($link);
?>
